layui.use(['form','layer','jquery','laypage','laydate','upload'],function() {
    var form = layui.form(),
        layer = parent.layer === undefined ? layui.layer : parent.layer,
        laypage = layui.laypage,
        $ = layui.jquery,
        laydate = layui.laydate,
        upload = layui.upload;
    form.on('radio(encrypt)', function(data){
       if(data.value==1){
           $(".ccsj").removeClass("layui-hide")
       }else{
           $(".ccsj").addClass("layui-hide")
       }
    });
    $("#ccsj").val(showday())
    form.on('submit(demo1)', function(data) {
        var dataT = data.field;
        var files=$("#image").attr("src")
        var bh={"file":files};
        console.log(bh)
        var json = {};
        json = eval('('+(JSON.stringify(bh)+JSON.stringify(dataT)).replace(/}{/,',')+')');
        //console.log(json)
        sendAjax(add, json, function () {
            window.location.href="./pm2.html";
        });
        return false

    });

});
//初始化扫描二维码按钮，传入自定义的 node-type 属性
$(function() {
    Qrcode.init($('[node-type=qr-btn]'));
});